<?php

namespace Modules\Api\Http\Controllers;

use Illuminate\Http\Request;
use Modules\Api\Service\ShopService;
use Modules\Api\Service\RepairstoreGoodsService;

class ShopController extends BaseController
{
    /**
     * 获取门店列表（维修店）
     *
     * 2019 12 02
     **/
    public function get_shop_list(Request $request)
    {
        $arrInput = $request->all();

        $arr_list = ShopService::get_shop_list($arrInput);

        return response_json($arr_list);
    }


    /**
     *  获取门店详情
     *
     * 2019 12 03
     **/
    public function get_shop_info(Request $request)
    {
        $arrInput = $request->all();
        $arrInput['user_id'] = api_user_id(); //用户id

        $info = ShopService::get_shop_info((array)$arrInput);

        return response_json($info);
    }

    /**
     * 车检维修专区-首页
     *
     * @return array|void
     * @author wumengmeng <wu_mengmeng@foxmail.com>
     */
    public function shop_special_performance_index(){
        try {
            return ShopService::api_shop_special_performance();
        }
        catch (\Exception $exception) {
            return hello_error('失败',[],$exception->getMessage());
        }
    }

    /**
     * 车检维修专区-首页  获取所有维修店服务商品（按距离等条件筛选）
     *
     * @return array|void
     * @author wumengmeng <wu_mengmeng@foxmail.com>
     */
    public function get_all_shop_repair_goods(Request $request)
    {
        $data = $request->all();

        $arr_list = ShopService::get_all_shop_repair_goods($data);

        return response_json($arr_list);
    }

    /**
     *  车检维修专区-  获取维修种类
     */
    public function get_repair_type()
    {
        $arr_list = ShopService::get_repair_type();

        return response_json($arr_list);
    }


}